package com.data4.feignapi.client;


import com.data4.feignapi.dto.ProductPageDTO;
import com.data4.feignapi.entity.Product;
import com.data4.feignapi.vo.ProductDetailVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.*;

@FeignClient(name = "supplier-service")
public interface SupplierClient {
    @GetMapping("/product/getProductById/{productId}")
    Product getProductById(@PathVariable Integer productId);

    @GetMapping("/product/getProductDetail/{productId}")
    ProductDetailVO getProductDetail(@PathVariable Integer productId);

    @GetMapping("/product/getProductByNameLike/Inter/{current}/{num}")
    ProductPageDTO getProductByNameLike(@RequestParam("productName") String productName,
                                        @PathVariable Integer current,
                                        @PathVariable Integer num);
}
